package com.webserver.core;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class WenServerApplication01 {
   private ServerSocket serverSocket;

   public WenServerApplication01(){
      try {
         System.out.println("正在启动服务端");
         serverSocket=new ServerSocket();
      System.out.println("服务端启动完毕");
      } catch (IOException e) {
         e.printStackTrace();
      }
   }

   public void start(){
      try {
         System.out.println("正在等待客户端连接");
         Socket socket=serverSocket.accept();
         System.out.println("一个客户端已连接");
      } catch (IOException e) {
         e.printStackTrace();
      }
   }

   public static void main(String[] args) {
      WebServerApplication server=new WebServerApplication();
      server.start();
   }
}
